#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include "rngs.h"
#include "unitTest4.h"


int unitTest4() {
    
    int seed = 1000;
    int numPlayer = 2;
    
	struct gameState G;
	int k[10] = {adventurer, gardens, embargo, village, minion, mine, cutpurse, 
		   sea_hag, tribute, smithy};
	
	
	printf("=========================\n TESTING ISGAMEOVER() FUNCTION \n=========================\n");
	
	initializeGame(numPlayer, k, seed, &G);
	
	//set province supply count to 0
	G.supplyCount[province] = 0;
	
	if(isGameOver(&G)==1){
		printf("TEST PASSED: Game over when supply of province is 0\n");
	} else {
		printf("TEST FAILED: Game should be over when supply of province is 0\n");
	}
	
	G.supplyCount[province] = 1;
	
	if(isGameOver(&G) == 0){
		printf("TEST PASSED: Game should not be over over when supply of province is 0 \n and there are not 3 empty piles \n");
	} else {
		printf("TEST FAILED: Game should be over over when supply of province is 0 \n and there are not 3 empty piles \n");
	}
	
	//Set 3 piles to 0
	G.supplyCount[0] = 0;
	G.supplyCount[1] = 0;
	G.supplyCount[2] = 0;
	
	if(isGameOver(&G)==1){
		printf("TEST PASSED: Game over when supply of 3 piles are empty\n");
	} else {
		printf("TEST FAILED: Game should be over when supply of 3 piles are empty\n");
	}

    return 0;
}


